#ifndef __SPI_H_
#define __SPI_H_

#include <stdint.h>

typedef enum {
	SPI_E_MODE_0,
	SPI_E_MODE_1,
	SPI_E_MODE_2,
	SPI_E_MODE_3,
	SPI_E_MODE_MAX,
} spi_mode_t;

typedef struct {
	spi_mode_t mode;
	uint32_t speed;
} spi_conf_t;

typedef void* spi_t;

spi_t spi_init(spi_conf_t conf);
int spi_write(spi_t spi, uint8_t* msg, uint32_t len);
void spi_deinit(spi_t spi);

#endif /* __SPI_H_ */
